
#import "LBRewardViewController.h"
#import <LbAdSdk/ADv.h>
#import <LbAdSdk/RewardVideo.h>
#import "Config.h"


@interface LBRewardViewController () <RewardVideoDelegate>
@property (nonatomic, strong) RewardVideo* rewardVideo;
@end

@implementation LBRewardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self showAD];
}


- (void)showAD{
   _rewardVideo = [ADv showRewardVideo:LB_TEST_REWARDVIDEO_ID viewController:self delegate:self];
}

- (void)reloadAD{
    [_rewardVideo reload];
}



// MARK:-loading
-(void) didFinishLoadingADWithPlacementID:(NSString *)placementID {
    NSLog(@"LBRewardViewController::didFinishLoadingADWithPlacementID:%@", placementID);
}

-(void) didFailToLoadADWithPlacementID:(NSString*)placementID error:(NSError*)error {
    NSLog(@"LBRewardViewController::didFailToLoadADWithPlacementID:%@ error:%@", placementID, error);
}

// MARK:-rewarded
-(void) rewardedVideoDidRewardSuccessForPlacemenID:(NSString *)placementID extra:(NSDictionary *)extra{
    NSLog(@"LBRewardViewController::rewardedVideoDidRewardSuccessForPlacemenID:%@ extra:%@",placementID,extra);
}

-(void) rewardedVideoDidStartPlayingForPlacementID:(NSString *)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBRewardViewController::rewardedVideoDidStartPlayingForPlacementID:%@ extra:%@", placementID, extra);
}

-(void) rewardedVideoDidEndPlayingForPlacementID:(NSString*)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBRewardViewController::rewardedVideoDidEndPlayingForPlacementID:%@ extra:%@", placementID, extra);
}

-(void) rewardedVideoDidFailToPlayForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary *)extra {
    NSLog(@"LBRewardViewController::rewardedVideoDidFailToPlayForPlacementID:%@ error:%@ extra:%@", placementID, error, extra);
}

-(void) rewardedVideoDidCloseForPlacementID:(NSString*)placementID rewarded:(BOOL)rewarded extra:(NSDictionary *)extra {
    NSLog(@"LBRewardViewController::rewardedVideoDidCloseForPlacementID:%@, rewarded:%@ extra:%@", placementID, rewarded ? @"yes" : @"no", extra);
}

-(void) rewardedVideoDidClickForPlacementID:(NSString*)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBRewardViewController::rewardedVideoDidClickForPlacementID:%@ extra:%@", placementID, extra);
}


@end
